-
Notifications
You must be signed in to change notification settings - Fork 520
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat : pt: support property fitting #3488
Conversation
…. Not include denoise and data format.
for more information, see https://pre-commit.ci
from deepmd.pt.model.model.property_model import ( | ||
PropertyModel, | ||
) |
Check notice
Code scanning / CodeQL
Cyclic import Note
deepmd.pt.model.model.property_model
from .dp_model import ( | ||
DPModel, | ||
) |
Check notice
Code scanning / CodeQL
Cyclic import Note
deepmd.pt.model.model.dp_model
def eval( | ||
self, | ||
coords: np.ndarray, | ||
cells: Optional[np.ndarray], | ||
atom_types: Union[List[int], np.ndarray], | ||
atomic: bool = False, | ||
fparam: Optional[np.ndarray] = None, | ||
aparam: Optional[np.ndarray] = None, | ||
mixed_type: bool = False, | ||
**kwargs: Dict[str, Any], | ||
) -> Tuple[np.ndarray, ...]: |
Check notice
Code scanning / CodeQL
Returning tuples with varying lengths Note
tuple of size 1
tuple of size 2
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## devel #3488 +/- ##
==========================================
- Coverage 77.68% 77.66% -0.02%
==========================================
Files 432 437 +5
Lines 37335 37523 +188
Branches 1620 1620
==========================================
+ Hits 29002 29143 +141
- Misses 7472 7519 +47
Partials 861 861 ☔ View full report in Codecov by Sentry. 🚨 Try these New Features:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is highly recommended to only provide property fitting imple. in this PR and provide all denoise supports in a separate PR.
@wanghan-iapcm Seemly I do not have the necessary permissions to add reviewers to a pull request in the repository. Can you give me higher access? |
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
I think dptest also needs to be implemented in this PR? |
the output stat should be replace by the |
#3480 is merging @Chengqian-Zhang please update the pr accordingly. |
@wanghan-iapcm Copy that, I will update immediately. |
I will complete this function in another PR #3867 |
Support property fitting:
One can fit multiple scalar properties at the same time (application scenario: predicting homo, lumo, bandgap of a structure at the same time), the number of properties to be fitted is determined by the "task_num" keyword in "model/fitting". Of course, it is possible to fit only 1 scalar property (same as energy).
But at the moment, it only supports averaging atomic_property to get the final property, and it doesn't add bias to each element type (different from energy), more comprehensive functions will be realized in the future pr.
You'll notice that I've also modified some parts of denoise, but due to the complexity of denoise fitting and the unfinished refactoring of the loss part @iProzd , the denoise functionality has not been fully implemented in this pr.